<template>
  <div class="detailTop">
    <div class="content">
      <img :src="path" alt="" />
      <!-- 遮罩 -->
      <div class="mask" ref="mask"></div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    path: {
      type: String,
      default: () => '',
      require: true
    }
  },
  methods: {
    // 改变遮罩的方法
    changeMask (opacity) {
      this.$refs.mask.style.opacity = opacity
    }
  }
}
</script>

<style lang="scss" scoped>
.detailTop {
  width: 100%;
  height: 500px;
  overflow: hidden;
  position: relative;
  .mask {
    position: absolute;
    background-color: #000;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
  }
  img {
    width: 100%;
    height: 100%;
  }
}
</style>
